package com.oilsoft.module.graphics.ui.model
{
	import com.oilsoft.shared.events.FileUploadEvent;
	
	import flash.events.Event;
	import flash.events.EventDispatcher;
	import flash.events.IEventDispatcher;
	import flash.utils.ByteArray;
	
	public class GnuPlotGraphicModel extends EventDispatcher
	{
		
		
		public function process():void
		{
			var event:FileUploadEvent = new FileUploadEvent(FileUploadEvent.EXECUTE);
			dispatcher.dispatchEvent(event);
		}
		
		
		public function upload(data:ByteArray,fileName:String):void
		{
			var event:FileUploadEvent = new FileUploadEvent(FileUploadEvent.UPLOAD2);
			event.data = data;
			event.fileName = fileName;
			dispatcher.dispatchEvent(event);
			
		}
		private var _graphicXML:String;
		
		[Bindable(event="changeByteArray")]
		public function get graphicXML():String
		{
			return _graphicXML;
		}
		
		public function set graphicXML(value:String):void
		{
			_graphicXML=value;
			dispatchEvent(new Event("changeByteArray"));
		}
		
		private var dispatcher:IEventDispatcher;
		
		public function GnuPlotGraphicModel(dispatcher:IEventDispatcher=null)
		{
			this.dispatcher=dispatcher;
		}
	}
}